package com.bix.util.blizfiles.mpq;

import java.io.FileNotFoundException;
import java.io.IOException;

public class MPQTest {
	public static void main (String args[]) {
		String	filename = "C:\\Program Files\\World of Warcraft\\Data\\common.MPQ";
		// String	filename = "C:\\test.cmd";
		
		try {
			MPQ mpq = new MPQ (filename);
			
			if (mpq.isValid()) {
				System.out.println (mpq);
			} else {
				System.out.println ("Specified file is not a valid MPQ file.");
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MPQException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		int hash = MPQCrypt.HashString("(hash table)", 3);
		System.out.println ("Hash: 0x" + Integer.toHexString(hash));
	}
}
